﻿using System.Reflection;
using Abp.AutoMapper;
using Abp.Localization;
using Abp.Modules;
using LeadThing.AbpZeroTemplate.Authorization;
using LeadThing.AbpZeroTemplate.BasicPersons.Authorization;
using LeadThing.AbpZeroTemplate.SpecialPersons.Authorization;
using LeadThing.AbpZeroTemplate.PersonTypes.Authorization;
using LeadThing.AbpZeroTemplate.Areas.Authorization;
using LeadThing.AbpZeroTemplate.GridPersons.Authorization;
using LeadThing.AbpZeroTemplate.DisputeTypes.Authorization;
using LeadThing.AbpZeroTemplate.DisputeInformations.Authorization;
using LeadThing.AbpZeroTemplate.CaseCategorys.Authorization;
using LeadThing.AbpZeroTemplate.WorkFlows.Authorization;
using LeadThing.AbpZeroTemplate.WorkFlow_Processs.Authorization;
using LeadThing.AbpZeroTemplate.WorkFlow_Runs.Authorization;
using LeadThing.AbpZeroTemplate.WorkFlow_Run_Processs.Authorization;
using LeadThing.AbpZeroTemplate.SupportingSystems.Authorization;
using LeadThing.AbpZeroTemplate.AssessmentReports.Authorization;
using LeadThing.AbpZeroTemplate.ProjectStatuss.Authorization;
using LeadThing.AbpZeroTemplate.WorkFlow_TableNames.Authorization;
using LeadThing.AbpZeroTemplate.CallPolices.Authorization;
using LeadThing.AbpZeroTemplate.CallTypes.Authorization;
using LeadThing.AbpZeroTemplate.LawsRegulationses.Authorization;
using LeadThing.AbpZeroTemplate.Notifications.Authorization;
using LeadThing.AbpZeroTemplate.ArticleCategorys.Authorization;
using LeadThing.AbpZeroTemplate.Articles.Authorization;
using LeadThing.AbpZeroTemplate.VersionApps.Authorization;
using LeadThing.AbpZeroTemplate.CommandDispatches.Authorization;
using LeadThing.AbpZeroTemplate.VideoReceiverses.Authorization;
using LeadThing.AbpZeroTemplate.CameraManages.Authorization;
using LeadThing.AbpZeroTemplate.UserMeetingRefs.Authorization;
using LeadThing.AbpZeroTemplate.FireFightingWorks.Authorization;

namespace LeadThing.AbpZeroTemplate
{
    /// <summary>
    /// Application layer module of the application.
    /// </summary>
    [DependsOn(typeof(AbpZeroTemplateCoreModule))]
    public class AbpZeroTemplateApplicationModule : AbpModule
    {
        public override void PreInitialize()
        {
            //Adding authorization providers
            Configuration.Authorization.Providers.Add<AppAuthorizationProvider>();

            Configuration.Authorization.Providers.Add<BasicPersonAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<SpecialPersonAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<PersonTypeAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<AreaAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<GridPersonAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<DisputeTypeAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<DisputeInformationAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<CaseCategoryAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<WorkFlowAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<WorkFlow_ProcessAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<WorkFlow_TableNameAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<SupportingSystemAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<AssessmentReportAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<ProjectStatusAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<CallPoliceAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<CallTypeAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<LawsRegulationsAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<NotificationAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<ArticleCategoryAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<ArticleAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<VersionAppAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<CommandDispatchAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<VideoReceiversAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<CameraManageAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<UserMeetingRefAppAuthorizationProvider>();
            Configuration.Authorization.Providers.Add<FireFightingWorkAppAuthorizationProvider>();


            //Adding custom AutoMapper mappings
            Configuration.Modules.AbpAutoMapper().Configurators.Add(mapper =>
            {
                CustomDtoMapper.CreateMappings(mapper);
            });
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
        }
    }
}
